﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Minecraft.ServerHall
{
	public static class SurvivorExt
	{
		/// <summary>
		/// 获取最新的幸存者id
		/// </summary>
		/// <param name="session"></param>
		/// <returns></returns>
		public static int GetNewSurvivorId(this MinecraftSession session)
		{
			if (!session.minecraftSessionInfo.survivorList.Any())
			{
				return 1;
			}
			int maxid = session.minecraftSessionInfo.survivorList.Max(m => m.SurvivorId);
			return maxid + 1;
		}
	}
}
